package com.aierkeji.b2c.entity;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;


@Entity
@Table(name = "akj_auser_alipay_ref")
@IdClass(AkjAuserLiferePK.class)
public class AkjAuserLifere {

	@Id
	@ManyToOne(targetEntity = AkjAuser.class, cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "au_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjAuser user;
	@Id
	@ManyToOne(targetEntity = AkjAlipayLife.class, cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "ali_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjAlipayLife akjAlipayLife;

	@ManyToOne(targetEntity = AkjAuser.class, cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "create_by", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	private AkjAuser createBy;

	@Column(columnDefinition = "datetime")
	private Timestamp createAt;

	public AkjAuser getUser() {
		return user;
	}

	public void setUser(AkjAuser user) {
		this.user = user;
	}

	public AkjAlipayLife getAkjAlipayLife() {
		return akjAlipayLife;
	}

	public void setAkjAlipayLife(AkjAlipayLife akjAlipayLife) {
		this.akjAlipayLife = akjAlipayLife;
	}

	public AkjAuser getCreateBy() {
		return createBy;
	}

	public void setCreateBy(AkjAuser createBy) {
		this.createBy = createBy;
	}

	public Timestamp getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Timestamp createAt) {
		this.createAt = createAt;
	}

}
